package com.ruoyi.tj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.tj.entity.ZfZhufangjibenxinxi;
import com.ruoyi.tj.entity.ZfZhufangtijianxinxi;
import com.ruoyi.tj.mapper.ZfZhufangjibenxinxiMapper;
import com.ruoyi.tj.service.ZfZhufangjibenxinxiService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 住房-住房基本信息 服务实现类
 * </p>
 *
 * @author aoliao
 * @since 2024-03-14
 */
@Service
public class ZfZhufangjibenxinxiServiceImpl extends BaseBizServiceImpl<ZfZhufangjibenxinxiMapper, ZfZhufangjibenxinxi> implements ZfZhufangjibenxinxiService {

    @Override
    @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, rollbackFor = Throwable.class)
    public void deleteByXiaoquIds(List<String> xiaoquIds) {
        LambdaQueryWrapper<ZfZhufangjibenxinxi> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(ZfZhufangjibenxinxi::getDeptId, xiaoquIds);
        List<ZfZhufangjibenxinxi> list = this.list(queryWrapper);
        for (ZfZhufangjibenxinxi one : list) {
            one.setDeleted(true);
        }
        this.saveOrUpdateBatch(list);
    }
}
